package com.mdd.admin.validate.teacher;

import com.mdd.admin.validate.BaseParam;
import com.mdd.common.validator.annotation.IDMust;
import com.mdd.common.validator.annotation.IntegerContains;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;

import lombok.Data;
import javax.validation.constraints.*;

/**
 * 讲师参数
 * @author panweiliang
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class TeacherParam extends BaseParam {

    @IDMust(message = "id参数必传且需大于0", groups = {update.class, delete.class, change.class})
    private Integer id;

//    @NotNull(message = "number参数缺失", groups = {create.class, update.class})
//    @DecimalMin(value = "0", message = "number参数值不能少于0", groups = {create.class, update.class})
    private Long number;

    @NotNull(message = "name参数缺失", groups = {create.class, update.class})
    @NotEmpty(message = "姓名不能为空字符", groups = {create.class, update.class})
    @Length(max = 16, message = "name参数不能超出16个字符", groups = {create.class, update.class})
    private String name;

    @NotNull(message = "avatar参数缺失", groups = {create.class, update.class})
    @NotEmpty(message = "头像不能为空字符", groups = {create.class, update.class})
    @Length(max = 128, message = "avatar参数不能超出128个字符", groups = {create.class, update.class})
    private String avatar;

//    @NotNull(message = "gender参数缺失", groups = {create.class, update.class})
    @IntegerContains(values = {0, 1, 2}, message = "gender参数值不在符合范围", groups = {create.class, update.class})
    private Integer gender = 1;

//    @NotNull(message = "synopsis参数缺失", groups = {create.class, update.class})
    @Length(max = 255, message = "synopsis参数不能超出255个字符", groups = {create.class, update.class})
    private String synopsis;

    private String introduce;

    @NotNull(message = "status参数缺失", groups = {create.class, update.class})
    @IntegerContains(values = {0, 1}, message = "status参数值不在符合范围", groups = {create.class, update.class, change.class})
    private Integer status;

//    @NotNull(message = "sort参数缺失", groups = {create.class, update.class})
    @DecimalMin(value = "0", message = "sort参数值不能少于0", groups = {create.class, update.class})
    private Integer sort = 0;

}
